<template>
  <z-card title="快捷入口" class="quick_room">
    <div class="item" v-for="item in list">
      <div class="icon" @click="goRouter(item.name)">
        <z-component :is="item.icon" />
      </div>
      <div class="label">{{ item.label }}</div>
    </div>
  </z-card>
</template>

<script lang="ts" setup>
import { ref, reactive, type Component } from "vue";
import ZCard from "@/components/common/card/index.vue";
import ZComponent from "@/components/admin/menu/component/index.vue";
import { IconUser } from "@arco-design/web-vue/es/icon";
import { useRouter } from "vue-router";
const router = useRouter();
interface quickItem {
  label: string;
  icon: string | Component;
  name: string;
}
const list: quickItem[] = [
  {
    label: "用户信息",
    icon: IconUser,
    name: "UserInfo",
  },
  {
    label: "用户列表",
    icon: IconUser,
    name: "UserList",
  },
];

const goRouter = (name: string) => {
  router.push({
    name,
  });
};
</script>
<style lang="less">
.quick_room {
  margin-bottom: 20px;
  .body {
    display: flex;
    .item {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-right: 20px;
      &:last-child {
        margin-right: 0;
      }
      .icon {
        width: 50px;
        height: 50px;
        border-radius: 5px;
        background-color: var(--color-fill-2);
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        font-size: 20px;
        transition: all 0.3s;
        &:hover {
          transform: translateY(-4px);
        }
        .iconfont {
          font-size: 22px;
        }
      }
      .label {
        margin-top: 8px;
      }
    }
  }
}
</style>
